RWTH - Mindstorms NXT Toolbox

MAP_SetOutputModule

Writes the IO map to the output module

Contents

Syntax

MAP_SetOutputModule(motor, map)

MAP_SetOutputModule(motor, map, varargin)

Description

map = MAP_SetOutputModule(motor, map) writes the IO map to the output module at the given motor motor. The motor port can be addressed by MOTOR_A, MOTOR_B, MOTOR_C. The map structure has to provide all output module information, listed below.

Input:

map.TachoCount % internal, non-resettable rotation-counter (in degrees)

map.BlockTachoCount % block tacho counter, current motor position, resettable using, ResetMotorAngle (NXT-G counter since block start)

map.RotationCount % rotation tacho counter, current motor position (NXT-G counter since program start)

map.TachoLimit % current set tacho/angle limit, 0 means none set

map.MotorRPM % current pulse width modulation ?

map.Flags % update flag bitfield, commits any changing (see also varargin)

map.Mode % output mode bitfield 1: MOTORON, 2: BRAKE, 4: REGULATED

map.Speed % current motor power/speed

map.ActualSpeed % current actual percentage of full power (regulation mode)

map.RegPParameter % proportional term of the internal PID control algorithm

map.RegIParameter % integral term of the internal PID control algorithm

map.RegDParameter % derivate term of the internal PID control algorithm

map.RunStateByte % run state byte

map.RegModeByte % regulation mode byte

map.Overloaded % overloaded flag (true: speed regulation is unable to onvercome physical load on the motor)

map.SyncTurnParam % current turn ratio, 1: 25%, 2:50%, 3:75%, 4:100% of full volume

map = MAP_SetOutputModule(motor, map, varargin) sets the update flags explicit by the given arguments. 'UpdateMode': commits changes to the mode property 'UpdateSpeed': commits changes to the speed property 'UpdateTachoLimit': commits changes to the tacho limit property 'ResetCounter': resets internal movement counters, cancels current goal, and resets internal error-correction system 'UpdatePID': commits changes to PID regulation parameters 'ResetBlockTachoCount': resets block tacho count (block-relative position counter (NXT-G)) 'ResetRotationCount': resets rotation count (program-relative position counter (NXT-G))

Examples

  MAP_SetOutputModule(MOTOR_A, map);
  map = MAP_GetOutputModule(MOTOR_A);
  map.RegPParameter = 20;
  MAP_SetOutputModule(MOTOR_A, map, 'UpdatePID');

See also

MAP_GetOutputModule, NXT_WriteIOMap

Signature